import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import admin from '../layout/admin.vue'
import index from '../views/index.vue'
import order from '../views/order.vue'
import Login from '../views/login.vue'
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: admin,
      redirect: '/index',
      children: [
        {
          path: '/index',
          name: 'index',
          meta: {
            title: "主页"
          },
          component: index,
        },
        {
          path: '/order',
          name: 'order',
          meta: {
            title: "订单页"
          },
          component: order,
        },
      ]
    },  
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta: {
        title: "登录"
      },
    }, 
  ]
})

export default router
